<nb-card>
  <nb-card-header>查询区块信息</nb-card-header>
  <nb-card-body>
    <div *ngIf="showInput" class="row" >
      <div class="input-group col-lg-12">
        <input type="text" class="form-control" [(ngModel)]="blockHash" name="blockHash" placeholder="输入区块HASH值">
        <span class="input-group-append">
            <button class="btn btn-primary input-group-text" (click)="submit()">
              查询
            </button>
          </span>
      </div>
    </div>
    <div *ngIf="!showInput" class="row" >
      <table class="table table-striped">
        <tr>
          <td>区块高度</td>
          <td>{{index}}</td>
        </tr>
        <tr>
          <td>前一区块HASH</td>
          <td><a [routerLink]="['/public/find-block']" [queryParams]="{hash: previousHash}">{{previousHash}}</a></td>
        </tr>
        <tr>
          <td>生成时间</td>
          <td>{{timestamp | date}}</td>
        </tr>
        <tr>
          <td>计算次数</td>
          <td>{{nonce}}</td>
        </tr>
        <tr>
          <td>难度值</td>
          <td>{{difficulty}}</td>
        </tr>
        <tr>
          <td>内容</td>
          <td>{{content}}</td>
        </tr>
      </table>
    </div>
  </nb-card-body>
</nb-card>
